// ex7_13_2.cpp
#include <iostream>

int main(void)
{
	using namespace std;
	double golf[10];
	cout << "Enter golf grade (1-10) ('#' to quit):\n";
	double val, sum1 = 0.0,average = 0.0;
	int cnt = 0;
	while (cin >> val && val != '#')
	{
		if (cin.fail())
			break;
		golf[cnt] = val;
		sum1 += val;
		++cnt;
		if (cnt == 10)
			break;

	}
	average = sum1 / cnt;
	cout << "Total of golf is: " << sum1 
		 << "\taverage is: " << average << endl;

	cout << "Bye!\n";
}
